<style>
    body{
        font-family: Helvetica;
        font-size: 11px;
    }

    th {
        background-color: black;
        color: white;
    }

    td,th{
        padding: 5px;
    }

    .summary{
        margin-right: 50px;
        margin-bottom: 20px;
    }
</style>
<?php $cycle = $this->cycle(array("#ccffcc","#99ff99")); ?>
<div class="summary" style="float:left;">
<h3>Status toko</h3>
<table>
    <thead>
        <th>Status</th>
        <th>Jumlah</th>
    </thead>
    <?php $total = 0; ?>
    <tr style="background-color: <?= $cycle->next(); ?>;">
        <td>Aktif</td>
        <td><?= $this->accept." toko"; ?></td>
        <?php $total += $this->accept; ?>
    </tr>
    <tr style="background-color: <?= $cycle->next(); ?>;">
        <td>Belum Disetujui</td>
        <td><?= $this->pending." toko"; ?></td>
        <?php $total += $this->pending; ?>
    </tr>
    <tr style="background-color: <?= $cycle->next(); ?>;">
        <td>Ditolak</td>
        <td><?= $this->reject." toko"; ?></td>
        <?php $total += $this->reject; ?>
    </tr>
    <tfoot style="background-color: <?= $cycle->next(); ?>; font-weight: bolder;">
        <td>Total</td>
        <td><?=$total." toko"?></td>
    </tfoot>
</table>
</div>
<div class="summary" style="float:left; clear:left;">
<?php $cycle->rewind(); ?>
<h3>Jumlah toko per kategori</h3>
<table>
    <thead>
        <th>Kategori</th>
        <th>Jumlah</th>
    </thead>
    <?php foreach($this->categories as $key): ?>
    <tr style="background-color: <?= $cycle->next(); ?>;">
        <td><?= $this->escape($key->name); ?></td>
        <td><?= $this->escape($key->total)." toko"; ?></td>
    </tr>
    <?php endforeach; ?>
</table>
</div>
<div class="summary" style="float:left;">
<?php $cycle->rewind(); ?>
<h3>Jumlah toko per keanggotaan</h3>
<table>
    <thead>
        <th>Keanggotaan</th>
        <th>Jumlah</th>
    </thead>
    <?php foreach($this->membership as $key): ?>
    <tr style="background-color: <?= $cycle->next(); ?>;">
        <td><?= $this->escape($key->name); ?></td>
        <td><?= $this->escape($key->total)." toko"; ?></td>
    </tr>
    <?php endforeach; ?>
</table>
</div>
<div class="summary" style="float:left; clear:left;">
<?php $cycle->rewind(); ?>
<h3>5 toko dengan rating tertinggi</h3>
<table>
    <thead>
        <th>Nama</th>
        <th>Rating</th>
    </thead>
    <?php foreach($this->rating5 as $key): ?>
    <tr style="background-color: <?= $cycle->next(); ?>;">
        <td><?= $this->escape($key["name"]); ?></td>
        <td style="text-align: center;"><?= $this->escape($key["rating"]); ?></td>
    </tr>
    <?php endforeach; ?>
</table>
</div>
<div class="summary" style="float:left;">
<?php $cycle->rewind(); ?>
<h3>5 toko dengan pengunjung tertinggi</h3>
<table>
    <thead>
        <th>Nama</th>
        <th>Pengunjung</th>
    </thead>
    <?php foreach($this->hit5 as $key): ?>
    <tr style="background-color: <?= $cycle->next(); ?>;">
        <td><?= $this->escape($key["name"]); ?></td>
        <td style="text-align: center;"><?= $this->escape($key["hit"]); ?></td>
    </tr>
    <?php endforeach; ?>
</table>
</div>